const Controller = require('egg').Controller

class PersonalController extends Controller {

  async getPersonal() {
    const { ctx } = this
    let username = JSON.parse(ctx.request.query[0])
    console.log(username);
    let res = await ctx.service.personal.getPersonal(username)
    if(res) {
      ctx.body = {
        code: 20000,
        data: res
      }
    }else{
      ctx.body = {
        code:50000,
        data:'服务器异常'
      }
    }
  }

}

module.exports = PersonalController